var idlist = location.search
var id=idlist.slice(4,8)
var type=idlist.slice(8)
console.log(type)
function getData() {
    var listdeatils = 'http://81.71.65.4:3008/film/list?type='+type
    axios.get(listdeatils).then(function (result) {
        var list = result.data.data
        console.log(list)
        var htmlStr = ''
        for (var item in list) {
            var premiereAts = list[item].premiereAt
            var now = new Date(premiereAts)
            var time = now.getFullYear() + '-' + (now.getMonth() + 1) + '-' + now.getDate()
            var itemlist=list[item].actors
            var htmlItem=''
            for(var aa in itemlist){
                htmlItem+=
                `<li>
                    <div>
                        <img src="${itemlist[aa].avatarAddress}"alt="">
                        <p>${itemlist[aa].name}</p>
                        <p>${itemlist[aa].role}</p>
                    </div>
                </li>`
            }
            if (id == list[item].id) {

                htmlStr +=
                    `<img class="banner1" src="${list[item].poster}"alt=""/>
                <div class="banner2">
                  <div class="main">
                    <div class="main1">
                      <p class="main11"><span>${list[item].name}</span><span>${list[item].filmType.dx}</span></p>
                      <p class="main12"><span>${list[item].grade}</span><span>分</span></p>
                    </div>
                    <p class="main2">${list[item].filmType.content}</p>
                    <p class="main3">${time}上映</p>
                    <p class="main4">${list[item].nation} | ${list[item].runtime}分钟</p>
                    <p class="main5">
                      ${list[item].desc}
                    </p>
                  </div>
                  <div class="item">
                      <p class="item1">演职人员</p>
                      <ul>
                      ${htmlItem}
                      </ul>
                  </div>
                </div>`
            }
        }
        document.querySelector('.banner').innerHTML = htmlStr
    })
}
getData()
